package com.bw.controller;

import com.bw.entity.User;
import com.bw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 * Created by qpx on 2018/6/21.
 */
@RestController
public class ConsumerController {

    @Autowired
    UserService userService;

    @RequestMapping("/test/consumer")
    public Object consumer(){

        List<User> users = userService.selectByCondition(new User());
        System.out.println(Arrays.toString(users.toArray()));
        return new HashMap<String,Object>(){{
            put("code","1000");
            put("msg","操作成功");
            put("result",users);
        }
        };
    }
}
